package com.xc.stock.domain.basic.repository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.rp.spring.jpa.GenericJpaRepository;
import com.xc.stock.domain.basic.convert.IEntityPOConvert;
import com.xc.stock.domain.basic.convert.UserStaffConvert;
import com.xc.stock.domain.basic.entity.UserStaff;
import com.xc.stock.infrastructure.db.po.QUserStaffPO;
import com.xc.stock.infrastructure.db.po.UserStaffPO;
import com.xc.stock.infrastructure.db.repo.UserStaffRepo;

import lombok.RequiredArgsConstructor;

/**
 * AppVersionRepository
 *
 * @author xlfd
 * @email xlfd@gmail.com
 * @created 2021/10/25
 */
@Repository
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UserStaffRepository extends SimplePoConvertEntityRepository<UserStaff, UserStaffPO, Integer> {
	final UserStaffRepo repo;

	final UserStaffConvert convert;

	public UserStaff findUserStaff(Integer agentId) {
		return findOneIfMutil(QUserStaffPO.userStaffPO.agentId.eq(agentId));
	}
	
	@Override
	public GenericJpaRepository<UserStaffPO, Integer> repo() {
		return repo;
	}

	@Override
	public IEntityPOConvert<UserStaff, UserStaffPO> convert() {
		return convert;
	}
}
